package io.awen.modules.sign.service;

import com.baomidou.mybatisplus.extension.service.IService;
import io.awen.common.utils.PageUtils;
import io.awen.modules.sign.entity.SignContainerEntity;
import io.awen.modules.sign.qo.SignContainerQo;

import java.util.Date;
import java.util.Map;

/**
 * 容器信息表
 *
 * @author liu.wen
 * @email liu.wen@qq.com
 * @date 2022-08-10 00:47:08
 */
public interface SignContainerService extends IService<SignContainerEntity> {

    /**
     * 通过 sensorId 在内存中获取对应容器
     * @param sensorId
     * @return
     */
    SignContainerEntity findContainer(String sensorId);

    SignContainerEntity findContainer(Long id);
    SignContainerEntity findAllContainer(Long id);
    SignContainerEntity findContainerById(Long id);

    /**
     * 更新容器液位值
     * @param sensorId
     * @param value
     */
    void updateSensorValue(String sensorId, Double value, Date dataTime);

    /**
     * 分页查询
     * @param qo
     * @return
     */
    PageUtils queryPage(SignContainerQo qo);

    void saveAndCache(SignContainerEntity signContainer);

    void updateAndCache(SignContainerEntity signContainer);
    void updateWithoutSensor(SignContainerEntity signContainer);

    int total(SignContainerQo qo);

    Map<String, SignContainerEntity> getSensorContainerMap();

    SignContainerEntity getBySensorId(String sensorId);


}

